<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <link rel="icon" href="*{/images/favicon.ico}" type="image/x-icon" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>404 访问页面不存在</title>
  <link rel="stylesheet" href="*{/assets/blockrain/css/style.css}">
  <link rel="stylesheet" href="*{/assets/blockrain/css/blockrain.css}">
  <script type="text/javascript" src="*{/js/jquery.js}"></script>
</head>
<body>
<div id="error_info">
<h2 style="margin-left:10px;">错误：HTTP 404 访问页面不存在</h2>
<h6 style="margin-left:10px;" onclick="javascript:$('#error_info').hide();$('#examples').show();">JPhenix For ChenXinSoft.com</h6>
</div>
<section id="examples" style="display:none;">
  <article id="example-slider">
    <div class="example">
      <div class="theme">主题: <span>"candy"</span></div>
      <div class="instructions">
        使用方向键控制
        <div class="keyboard">
          <div class="key key-up"></div>
          <div class="key key-left"></div>
          <div class="key key-down"></div>
          <div class="key key-right"></div>
        </div>
      </div>
      <div class="game" id="tetris-demo"></div>
    </div>
    <div class="buttons">
      <a href="" class="btn btn-prev">上一个</a>
      <a href="" class="btn btn-next">下一个</a>
    </div>
  </article>
</section>
<script src="*{/assets/blockrain/js/blockrain.jquery.libs.js}"></script>
<script src="*{/assets/blockrain/js/blockrain.jquery.src.js}"></script>
<script src="*{/assets/blockrain/js/blockrain.jquery.themes.js}"></script>
<script type="text/javascript">
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','*{/assets/blockrain/js/analytics.js}','ga');
  
  var versusSpeed = 100;
  var $demo = $('#tetris-demo').blockrain({
    speed: 20,
    theme: 'candy',
    onStart: function() {
      ga( 'send', 'event', 'tetris', 'started');
    },
    onLine: function() {
      ga( 'send', 'event', 'tetris', 'line');
    },
    onGameOver: function(score){
      ga( 'send', 'event', 'tetris', 'over', score);
    }
  });
  
  $('#example-slider').find('.btn-next').click(function(event){
    event.preventDefault();
    switchDemoTheme(true);
  });
  $('#example-slider').find('.btn-prev').click(function(event){
    event.preventDefault();
    switchDemoTheme(false);
  });

  function switchDemoTheme(next) {
    var themes = Object.keys(BlockrainThemes);
    var currentTheme = $demo.blockrain('theme');
    var currentIx = themes.indexOf(currentTheme);
    if( next ) { currentIx++; }
    else { currentIx--; }
    if( currentIx >= themes.length ){ currentIx = 0; }
    if( currentIx < 0 ){ currentIx = themes.length-1; }
    $demo.blockrain('theme', themes[currentIx]);
    $('#example-slider .theme span').text( '"'+themes[currentIx]+'"' );
  }
</script>
</body>
</html>
